#include <stdio.h>
#include <unistd.h>

int main()
{
    //printf("begin fork()\n");
    //fork();
    //printf("end fork\n");
    pid_t pid = fork();
    if(pid<0)
    {
        printf("faild\n");
        return 0;
    }
    else if(pid==0)
    {
        printf("i am subprocess,my pid:%d my father pid:%d\n",getpid(),getppid());
    }
    else 
    {
        printf("i am fatherprocess,my pid:%d my father pid:%d\n",getpid(),getppid());
    }
    return 0;
}
